import request from '@/utils/candidate_request'

// 注册接口
export const candidateRegisterService = ({ username, password }) =>
  request.post('/reg/user', { username, password })

// 登录接口
export const candidateLoginService = ({ username, password }) =>
  request.post('/login/user', { username, password })

// 获取用户基本信息&渲染
export const candidateGetInfoService = (username) =>
  request.post('/user/userinfo', username)

// 更新个人基本资料
export const candidateUpdateInfoService = ({ candidate }) =>
  request.post('/user/profile', candidate) // 直接传递对象作为请求体

// 修改头像
export const candidateUploadAvatarService = ({ candidate }) =>
  request.patch('/user/avatar', candidate)

// 修改密码
export const candidateUpdatePassService = ({ username, password }) =>
  request.patch('/user/password', { username, password })

// 上传简历
export const candidateUplaodResumeService = (_formData) =>
  request.post('/user/uploads', _formData)

//获取已上传简历信息列表
export const resumeGetsService = (username) =>
  request.post('/user/relist', username)
//删除简历
export const resumeDeleteService = (resumeinformationid) =>
  request.delete(`/user/manage/${resumeinformationid}`)
